<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
# 引入Router类
use think\facade\Route;

/*
 *
 Route::get('think', function () {
    return 'hello,ThinkPHP5!';
});

Route::get('hello/:name', 'index/hello');

return [

];
*/

//路由规则
// 第一个参数：url地址
// 第二个参数：模块/控制器/方法

// 分组路由
// 接口路由
Route::group('api', function () {
    // 菜单路由
    Route::get('menu/list', 'api/Menu/read');
    // 图片上传路由
    Route::post('upload/image', 'api/Brand/uploadImage');
    // 商品路由
    Route::group('item', function () {
        Route::get('category/list', 'api/Category/findAll');
        Route::get('brand/page', 'api/Brand/page');
        Route::post('brand', 'api/Brand/addBrand');
        Route::get('brand/categories/:bid', 'api/Brand/findCategoriesByBid');
        Route::put('brand/editBrand', 'api/Brand/editBrand');
    });
});

